<?php

namespace app\common\validate;

use think\Validate;

class Common extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule =   [
        'cellphone'  =>  ['require', 'regex' => '/^1[3|4|5|6|7|8|9][0-9]\d{8}$/'],
    ];
    
    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */
    protected $message  =   [
        'cellphone'=>'手机号码格式不正确'
    ];

    protected $scene = [
        'smsCode'  =>  ['cellphone'],
    ];
}
